package object.thethis;

import org.testng.annotations.Test;

public class TheThis {
    @Test
    public void t1() {
        Season season = new Season("string", 1);
        System.out.println(season);
        season.setName("NotString");
        System.out.println(season);
    }
}

class Season {
    private String name;
    private int order;

    public Season(String theName, int theOrder) {
        name = theName;
        order = theOrder;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        // 使用this仅是因为传入的参数和变量重名了，没有其他的原因
        this.name = name;
    }

    public int getOrder() {
        return order;
    }

    public void setOrder(int theOrder) {
        order = theOrder;
    }

    @Override public String toString() {
        return "Season{" + "name='" + name + '\'' + ", order=" + order + '}';
    }
}
